#!/usr/bin/python2.5
#
# Copyright 2012 Maxim Velikobratov (Jaropolk)
#

"""Utility methods."""

from google.appengine.api import memcache


def memcache_get(key):
  """Gets data from the memcache."""
  return memcache.get(key)


def memcache_set(key, val):
  """Sets data in the memcache."""
  return memcache.set(key, val) 


def clear_memcache():
  """Clear the memcache."""

  if not memcache.flush_all(): 
    logging.error('Failed to clear the cache!')

